Optimal. Leaf size=156 \[ \frac {8 i a^3 (a+i a \tan (c+d x))^{n-3} (e \sec (c+d x))^{6-2 n}}{d (5-n) \left (n^2-7 n+12\right )}+\frac {4 i a^2 (a+i a \tan (c+d x))^{n-2} (e \sec (c+d x))^{6-2 n}}{d \left (n^2-9 n+20\right )}+\frac {i a (a+i a \tan (c+d x))^{n-1} (e \sec (c+d x))^{6-2 n}}{d (5-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.23, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {3494, 3493} \[ \frac {8 i a^3 (a+i a \tan (c+d x))^{n-3} (e \sec (c+d x))^{6-2 n}}{d (5-n) \left (n^2-7 n+12\right )}+\frac {4 i a^2 (a+i a \tan (c+d x))^{n-2} (e \sec (c+d x))^{6-2 n}}{d \left (n^2-9 n+20\right )}+\frac {i a (a+i a \tan (c+d x))^{n-1} (e \sec (c+d x))^{6-2 n}}{d (5-n)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3493
Rule 3494
Rubi steps
\begin {align*} \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^n \, dx &=\frac {i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}+\frac {(4 a) \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n} \, dx}{5-n}\\ &=\frac {4 i a^2 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n}}{d \left (20-9 n+n^2\right )}+\frac {i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}+\frac {\left (8 a^2\right ) \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n} \, dx}{20-9 n+n^2}\\ &=\frac {8 i a^3 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-3+n}}{d (3-n) \left (20-9 n+n^2\right )}+\frac {4 i a^2 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n}}{d \left (20-9 n+n^2\right )}+\frac {i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.19, size = 122, normalized size = 0.78 \[ -\frac {e^6 \sec ^5(c+d x) (\sin (3 (c+d x))+i \cos (3 (c+d x))) (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-2 n} \left (i \left (n^2-9 n+18\right ) \sin (2 (c+d x))+\left (n^2-9 n+22\right ) \cos (2 (c+d x))-2 (n-5)\right )}{d (n-5) (n-4) (n-3)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.58, size = 165, normalized size = 1.06 \[ \frac {{\left ({\left (-i \, n^{2} + 9 i \, n - 20 i\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (-i \, n^{2} + 11 i \, n - 30 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (2 i \, n - 12 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 i\right )} \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{-2 \, n + 6} e^{\left (i \, d n x + i \, c n - 6 i \, d x + n \log \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right ) + n \log \left (\frac {a}{e}\right ) - 6 i \, c\right )}}{2 \, {\left (d n^{3} - 12 \, d n^{2} + 47 \, d n - 60 \, d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (e \sec \left (d x + c\right )\right )^{-2 \, n + 6} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 2.23, size = 0, normalized size = 0.00 \[ \int \left (e \sec \left (d x +c \right )\right )^{6-2 n} \left (a +i a \tan \left (d x +c \right )\right )^{n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 3.28, size = 1062, normalized size = 6.81 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 10.33, size = 318, normalized size = 2.04 \[ \left (\cos \left (6\,c+6\,d\,x\right )-\sin \left (6\,c+6\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (\frac {e}{\cos \left (c+d\,x\right )}\right )}^{6-2\,n}\,\left (\frac {{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n}{d\,\left (n^3\,1{}\mathrm {i}-n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}-60{}\mathrm {i}\right )}-\frac {\left (2\,n-12\right )\,\left (\cos \left (2\,c+2\,d\,x\right )+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n}{2\,d\,\left (n^3\,1{}\mathrm {i}-n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}-60{}\mathrm {i}\right )}+\frac {\left (\cos \left (6\,c+6\,d\,x\right )+\sin \left (6\,c+6\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n\,\left (n^2-9\,n+20\right )}{2\,d\,\left (n^3\,1{}\mathrm {i}-n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}-60{}\mathrm {i}\right )}+\frac {\left (\cos \left (4\,c+4\,d\,x\right )+\sin \left (4\,c+4\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n\,\left (n^2-11\,n+30\right )}{2\,d\,\left (n^3\,1{}\mathrm {i}-n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}-60{}\mathrm {i}\right )}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________